package com.bwie.receman.controller;


import com.bwie.common.domain.Receive;
import com.bwie.common.domain.User;
import com.bwie.common.domain.request.*;
import com.bwie.common.result.PageResult;
import com.bwie.common.result.Result;
import com.bwie.receman.service.RecemanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
public class RecemanController {

    @Autowired
    private RecemanService recemanService;


    /**
     * 接诊台列表
     */
    @PostMapping("listreception")
    public Result<PageResult<Receive>>listreception(@RequestBody ReceiveRequest receiveRequest){
        Result<PageResult<Receive>>result=recemanService.listreception(receiveRequest);
        return result;
    }

    /**
     * 健康档案
     */
    @PostMapping("healthRecords/{receiveId}")
    public Result<List<Receive>>healthRecords(@PathVariable Integer receiveId){
        Result<List<Receive>>result=recemanService.healthRecords(receiveId);
        return result;
    }
    /**
     * 开启问诊
     */
    @PostMapping("openConsultation/{userId}")
    public Result openConsultation(@PathVariable Integer userId){
        return recemanService.openConsultation(userId);
    }

    /**
     * 关闭问诊
     */
    @PostMapping("closeConsultation/{userId}")
    public Result closeConsultation(@PathVariable Integer userId){
        return recemanService.closeConsultation(userId);

    }

    /**
     * 诊断管理
     */
    @PostMapping("diagnosticManagement")
    public Result<List<Receive>>diagnosticManagement(@RequestBody DiagnosticManagementRequest diagnosticManagementRequest){
        Result<List<Receive>>result=recemanService.diagnosticManagement(diagnosticManagementRequest);
        return result;
    }

    /**
     * 诊断管理查看
     */
    @PostMapping("diagnosticViewing/{receiveDate}")
    public Result<List<Receive>>diagnosticViewing(@PathVariable String receiveDate){
        Result<List<Receive>>result=recemanService.diagnosticViewing(receiveDate);
        return result;
    }

    /**
     * 诊断管理查看
     */
    @PostMapping("diagnosticViewings")
    public Result<List<Receive>>diagnosticViewings(@RequestBody DiagnosticViewingRequest diagnosticViewingRequest){
        Result<List<Receive>>result=recemanService.diagnosticViewings(diagnosticViewingRequest);
        return result;
    }

    /**
     * 生成诊断报告
     */
    @PostMapping("generateDiagnosticReport")
    public Result generateDiagnosticReport(@RequestBody AdmissionsRequest admissionsRequest){

        return recemanService.generateDiagnosticReport(admissionsRequest);
    }














}
